
import gui.CheckBox;
import gui.MenuBar;
import gui.TextBox;
import gui.Title;
import javax.microedition.lcdui.Canvas;
import javax.microedition.lcdui.Graphics;

/*
 * To change this template, choose Tools | Templates
 * and open the template in the editor.
 */
/**
 *
 * @author mrbao
 */
public class TestCanvas extends Canvas {

    CheckBox checkBox;
    TextBox textBox;
    Title title;
    MenuBar menuBar;

    public TestCanvas() {

        this.setFullScreenMode(true);
        checkBox = new CheckBox("pham xuan bao", true, 20, 5);
        textBox = new TextBox("baopx", 200, 20, 10);
        title = new Title("Baopx", getWidth());
        menuBar = new MenuBar("bao", "Exit", null, getWidth(), getHeight());
    }

    protected void keyPressed(int keyCode) {
        int gameCode = getGameAction(keyCode);
//        checkBox.KeyPress(gameCode);
        textBox.KeyPress(gameCode, keyCode);
        repaint();
    }

    protected void paint(Graphics g) {
        this.setFullScreenMode(true);
        g.setColor(0xffffff);
        g.fillRect(0, 0, getWidth(), getHeight());
//        checkBox.Paint(g);
//        textBox.paint(g);
        title.Paint(g);
        menuBar.Paint(g);
    }
}
